<template>
	<!-- 添加车辆 -->
	<view class="addCar">
		<u-navbar title="收料信息发布" title-color="#333" back-icon-color="#333"></u-navbar>
		<view class="addCar-bottom">
			<view class="zx-addres">
				<view class="xh-text" style="line-height: 200rpx;">
					<span class="xie-huo-dizhi">卸</span>
				</view>

				<view class="xhdz-xinxi" @click="xhdlistFun">
					<view class="">
						<view class="" style="padding:10rpx; color:#DB9370">
							<text>{{ xhdztitle.ORMTB491CA00 || '&nbsp;' }}</text>
						</view>
						<view class="" style="padding-bottom:10rpx;">
							<text>{{ xhdztitle.ORMTB491CA01 || '请添加站点地址' }}</text>
						</view>
					</view>
					<view class="" style="line-height: 200rpx;">
						<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
			<view class="addCar-content-box">
				<view class="cx-box flex">
					<text class="addCar-phone" style="width: 100rpx;">车型：</text>
					<u-radio-group v-model="cx">
						<u-radio label-size="32" v-for="(item, index) in list1" :key="index" :name="item.name"
							:disabled="item.disabled" :checked="item.checked">
							{{ item.name }}
						</u-radio>
					</u-radio-group>
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">物料类型：</text>
					<view class="addCar-phone-placeholder" @click="show = true">{{ msgobj.wllxName }}</view>
					<u-picker @confirm="bindPickerWlChange" mode="selector" v-model="show" :range="wlArray"
						range-key="SETTB206CA01"></u-picker>
				</view>
				<view class="addCar-carName-phone" v-if="userinfo.ORMTB410CB06 == '1'">
					<text class="addCar-phone">账户：</text>
					<picker class="addCar-input-one" @change="bindPickerdfzhChange" :value="msgobj.dfzh" :range="dfzhArray"
						range-key="ZHNAME">
						<i class="addCar-phone-placeholder" v-if="msgobj.dfzh < 0">请选择代发运单账户</i>
						<view v-else class="uni-input">{{ dfzhArray[msgobj.dfzh].ZHNAME }}</view>
					</picker>
				</view>
				<view class="addCar-carName-phone flex">
					<text class="addCar-phone" style="width: 100rpx;">厂家：</text>
					<view class="picker-view">
						<view class="addCar-phone-placeholder" v-if="msgobj.wllx < 0">请先选择物料类型</view>
						<w-select v-else v-model="msgobj.wlcj" placeholder="请选择厂家" :list="cjArray" valueName="SETTB99CA00"
							keyName="SETTB99ID" @change="pickerChange" multiple>
						</w-select>
					</view>
				</view>

				<view class="addCar-carName-phone">
					<text class="addCar-phone">收料单价(每吨)：</text>
					<input class="addCar-input-one" type="digit" placeholder="请输入" v-model="msgobj.sldj" maxlength="15" />
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">收料吨数(吨)：</text>
					<input class="addCar-input-one" type="digit" placeholder="请输入" v-model="msgobj.slds" maxlength="8" />
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">亏吨范围(吨)：</text>
					<input class="addCar-input-one" type="digit" placeholder="请输入" v-model="msgobj.kd" maxlength="3" />
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">超时时间(小时)：</text>
					<input class="addCar-input-one" type="digit" placeholder="请输入" v-model="msgobj.cssj" />
				</view>
				<view class="addCar-carName-phone" v-if="userinfo.ORMTB410CB06 == '1'">
					<text class="addCar-phone">管理费：</text>
					<input class="addCar-input-one" type="digit" placeholder="请输入管理费" v-model="msgobj.glf" />
					<text style="padding-left: 10rpx;">%</text>
				</view>
				<view class="addCar-carName-phone" style="display: flex;">
					<text class="addCar-phone">是否公开：</text>
					<text class="addCar-input-one"></text>
					<u-switch v-model="isgk" size="40" @change="change"></u-switch>
					<view class="" style="padding-left: 10rpx;">
						<text style="color: #A8A8A8;" v-if="isgk == false">否</text>
						<text style="color: #FF0000;" v-if="isgk == true">是</text>
					</view>
				</view>
				<view class="addCar-carName-phone" style="display: flex;">
					<text class="addCar-phone">是否指定车辆：</text>
					<text class="addCar-input-one"></text>
					<u-switch v-model="iszdcl" size="40" @change="changecl"></u-switch>
					<view class="" style="padding-left: 10rpx;">
						<text style="color: #A8A8A8;" v-if="iszdcl == false">否</text>
						<text style="color: #FF0000;" v-if="iszdcl == true">是</text>
					</view>
				</view>
				<view class="addCar-carName-phone" style="display: flex;">
					<text class="addCar-phone">接单物料冻结：</text>
					<text class="addCar-input-one"></text>
					<u-switch v-model="isjdwl" size="40" @change="changejdwl"></u-switch>
					<view class="" style="padding-left: 10rpx;">
						<text style="color: #A8A8A8;" v-if="isjdwl == false">否</text>
						<text style="color: #FF0000;" v-if="isjdwl == true">是</text>
					</view>
				</view>

				<view class="addCar-carName-phone" style="border: none;" v-if="iszdcl == true">
					<text class="addCar-phone" style="width:193rpx;">车牌号：</text>
					<view class="addCar-phone-car" @click="boardClick">
						{{ carNumberIpt }}
						<text></text>
						<view class="addCar-phone-placeholder" v-if="carNumberIpt == ''">请输入车牌号</view>
					</view>
					<text @click="carShowFun" style="color: rgba(0, 161, 244, 1);">历史车牌</text>
				</view>
				<view class="wrap" v-if="carList.length > 0" style="border-top: 1px solid rgba(230, 230, 230, 0.5);">
					<view class="addCar-carName-phone" style="border: none;" v-for="(item, index) in carList">
						<view class="addCar-phone-car">
							{{ item.carPlate }}
						</view>
						<text v-if="item.carPlate" @click="delCar(item)" style="color: rgba(0, 161, 244, 1);">删除</text>
					</view>
				</view>
			</view>
			<view class="text-jieshao">
				<text>{{ remark }}</text>
			</view>
			<view class="addCar-reset-determine">
				<view class="addCar-determine" @click="determine">确定</view>
			</view>
		</view>
		<u-popup v-model="carshow" length="100%" mode="right" @close="carclose">
			<view class="iscar-nav">
				<view class="iscar-nav-top" v-if="platform == false"></view>
				<view v-else :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<view class="iscar-nav-search">
					<view class="iscar-nav-search-btn" @click="carshow = false">
						返回
					</view>
					<view class="iscar-nav-search-ipt">
						<u-search placeholder="请输入车牌号" @custom="carcustom" @change="valChange" @focus="focusFun" @blur="blurFun"
							v-model="carSearch" :show-action="true" :action-style="actionStyle" action-text="添加"></u-search>
					</view>
				</view>
				<view class="iscar-nav-btn">
					<view @click="checkedAll" v-if="ischeckedAll == true">全选</view>
					<view @click="nocheckedAll" v-if="ischeckedAll == false">全不选</view>
					<view @click="determineFun">确定</view>
				</view>
			</view>
			<view class="iscar-content" :style="{ paddingTop: padingTop }">
				<view v-if="platform == true" :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<u-checkbox-group :wrap="false" width="350rpx" @change="checkboxGroupChange">
					<u-checkbox size='40' label-size="38" v-model="item.checked" v-for="(item, index) in carnumlist" :key="index"
						:name="item.name">{{ item.name }}</u-checkbox>
				</u-checkbox-group>
			</view>
		</u-popup>
		<u-modal v-model="addCarLoginShow" content="请确认是否发布该运单" :show-cancel-button="true" @confirm="addCarNewConfirm">
		</u-modal>
		<u-keyboard ref="uKeyboard" mode="car" @change="carValChange" @confirm="sucAdd" @backspace="carBackspace"
			v-model="carshow1" :mask="false" :mask-close-able="false"></u-keyboard>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userinfo: JSON.parse(uni.getStorageSync('userinfo')),
			platform: uni.getStorageSync('platform'),
			navHeight: '',
			carSearch: '',
			xhdztitle: {
				ORMTB491CA00: ''
			},
			xhdzqhID: 0,
			actionStyle: {
				backgroundColor: '#00a1f1',
				color: '#FFF',
				width: '100rpx',
				height: '60rpx',
				lineHeight: '60rpx',
				borderRadius: '15rpx',
				margin: '0 20rpx',
			},
			carnumlist: [],
			carList: [],
			ischeckedAll: true,
			componeryArr: [],
			addressNew: null,
			Index: 0,
			diasabledInput: true, //可读不可写
			carNumberIpt: '', //车牌号
			nameIpt: '', //车主姓名
			phoneIpt: '', //联系方式
			tareIpt: '', //联系方式
			addCarLoginShow: false,
			carshow1: false,
			carshow: false,
			carType: '',
			typeid: '',
			isgk: false,
			isgkdata: 1,
			iszdcl: false,
			iszdcldata: 2,
			isjdwl: false,
			isjdwldata: 0,
			msgobj: {
				dfzh: -1,
				wllx: -1,
				wlcj: -1,
				wlcjName: '',
				wllxName: '请选择物料',
				wllxCode: '', //物料类型编码
				sldj: '', //收料单价
				slds: '', //收料吨数
				kd: '',		//亏吨范围
				glf: '',  //管理费
				dfzhId: '', //代发账户 实际扣款人
				cssj: '24',
			},
			show: false,
			selectedValues: [],//选中厂家
			remark: '',
			dfzhArray: [],
			cjArray: [],
			xhArray: [],
			wlArray: [],
			page: 1,
			list1: [{
				name: '13米',
				checked: true,
				disabled: false
			},
			{
				name: '7米6',
				checked: false,
				disabled: false
			},
			{
				name: '9米6',
				checked: false,
				disabled: false
			}],
			cx: '13米',
			padingTop: '26vh',
		}
	},
	onLoad(op) {
		this.getdfzhList()
		this.getxhOrderList()
		this.queryGwcList()
		this.getRemark()
		this.valChange()
		this.xhdzFun()
	},
	onShow() {
		let that = this;
		this.systemInfo = uni.getSystemInfoSync()
		this.navHeight = this.systemInfo.platform == 'ios' ? 64 : 68;
		//监听自定义事件
		uni.$on("handClickSelectAddress", res => {
			that.handClickSelectAddress(res);
			//清除监听，不清除会消耗资源
			uni.$off('handClickSelectAddress');
		})
	},
	mounted() { },
	methods: {
		// 代发运单账户列表
		getdfzhList() {
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			uni.request({
				url: this.baseUrl + '/orm/ormtb410/selectYfAccount',
				method: 'POST',
				dataType: 'json',
				data: {

				},
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						if (!res.data.data || res.data.data == null) {
							this.dfzhArray = []
							return
						}
						var data = res.data.data || []
						this.dfzhArray = data
					} else {
						this.dfzhArray = []
						uni.showToast({
							title: res.data.message,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: '服务器连接超时',
						type: 'default',
						icon: false
					})
				}
			});
		},
		bindPickerdfzhChange: function (e) {
			console.log('picker发送选择改变，携带值为', e.detail.value)
			this.msgobj.dfzh = e.detail.value
			this.msgobj.dfzhId = this.dfzhArray[this.msgobj.dfzh].ZHID
		},
		carcustom() {
			this.carSearch = ''
			uni.navigateTo({
				url: '/pages/vehicleAddCar/index'
			})
		},
		focusFun() {
			this.padingTop = '30vh'
		},
		blurFun() {
			this.padingTop = '26vh'
		},
		pickerChange(e) {
			console.log(e.SETTB99ID, "chooseValue", e);
			let id = e.SETTB99ID
			if (!this.selectedValues.includes(id)) {
				this.selectedValues.push(id);
			} else {
				this.selectedValues = this.selectedValues.filter(
					value => value !== id
				);
			}
		},
		bindPickerWlChange(e) {
			// console.log(e,`output->e`, e)
			this.msgobj.wllx = e[0]
			this.msgobj.wllxName = this.wlArray[this.msgobj.wllx].SETTB206CA01
			this.msgobj.wllxCode = this.wlArray[this.msgobj.wllx].SETTB206CA00
			if (this.msgobj.wllxName) {
				console.log(this.msgobj.wllxCode, '物料', this.msgobj.wllxName)
				this.getCjList();
			}
		},
		change(e) {
			console.log('change', e);
			this.isgk = e
			if (this.isgk == true) {
				this.isgkdata = 2
			} else {
				this.isgkdata = 1
			}
			console.log(this.isgkdata)
		},
		changecl(e) {
			console.log('change', e);
			this.iszdcl = e
			if (this.iszdcl == true) {
				this.iszdcldata = 1

			} else {
				this.iszdcldata = 2
				this.carList = []
				this.carnumlist.forEach(function (element) {
					element.checked = false
				});
			}
		},
		changejdwl(e) {
			console.log('change', e);
			this.isjdwl = e
			if (this.isjdwl == true) {
				this.isjdwldata = 1
			} else {
				this.isjdwldata = 0
			}
			console.log(this.isjdwldata)
		},
		// 厂家列表
		getCjList() {
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			uni.request({
				url: this.baseUrl + '/orm/ormtb493/cjListBywl',
				method: 'POST',
				dataType: 'json',
				data: {
					ORMTB493CA05: this.msgobj.wllxCode,
					// SETTB100CA04: this.cityCode, //市代码
					page: this.page,
					limit: 100,
				},
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						if (!res.data.data || res.data.data == null) {
							this.cjArray = []
							this.page = 1
							return
						}
						var data = res.data.data || []
						// console.log(data)
						this.cjArray = data
					} else {
						this.cjArray = []
						this.page = 1
						uni.showToast({
							title: res.data.message,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: '服务器连接超时',
						type: 'default',
						icon: false
					})
				}
			});
		},
		handClickSelectAddress(item) {
			if (Object.keys(item).length > 0) {
				this.xhdztitle = item
				console.log(this.xhdztitle, 'xhdztitle')
			}
		},
		xhdlistFun() {
			uni.navigateTo({
				url: `/pages/receivingMaterials/addressList?ID=` + this.xhdztitle.ORMTB492ID  //站点id
			})
		},
		getRemark() {
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			uni.request({
				url: this.baseUrl + '/orm/ormtb493/getRemark',
				method: 'POST',
				dataType: 'json',
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						var data = res.data.data || []
						// console.log(data)
						this.remark = res.data.data
						console.log(res)
					} else {
						uni.showToast({
							title: res.data.message,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: '服务器连接超时',
						type: 'default',
						icon: false
					})
				}
			});
		},
		// 站点地址列表
		getxhOrderList() {
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			let id = '';
			if (this.userinfo.sign == 'CUS-1') {
				id = this.userinfo.ORMTB400ID
			} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
				id = this.userinfo.ORMTB410ID
			}
			uni.request({
				url: this.baseUrl + '/orm/ormtb492/ormtb492List',
				method: 'POST',
				dataType: 'json',
				data: {
					ORMTB410ID: id,
					sign: this.userinfo.sign,
					page: this.page,
					limit: 1000,
				},
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						if (!res.data.data || res.data.data == null) {
							this.xhArray = []
							this.page = 1
							return
						}
						var data = res.data.data || []
						// console.log(data)
						this.xhArray = data
					} else {
						this.xhArray = []
						this.page = 1
						uni.showToast({
							title: res.data.message,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: '服务器连接超时',
						type: 'default',
						icon: false
					})
				}
			});
		},
		// 物料列表
		queryGwcList() {
			uni.showLoading({
				title: '加载中...',
				mask: true
			});
			uni.request({
				url: this.baseUrl + '/orm/ormtb493/wlTypeList',
				method: 'POST',
				dataType: 'json',
				data: {
					sign: this.userinfo.sign,
				},
				success: (res) => {
					uni.hideLoading();
					if (res.data.code == 200) {
						this.wlArray = res.data.data || []
					} else {
						uni.showToast({
							title: res.data.success,
							type: 'default',
							icon: false
						})
					}
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: res.errMsg,
						type: 'default',
						icon: false
					})
				}
			});
		},
		carValChange(val) {
			// 将每次按键的值拼接到carNumberIpt变量中，注意+=写法
			this.carNumberIpt += val;
		},
		carBackspace() {
			// 删除carNumberIpt的最后一个字符
			if (this.carNumberIpt.length) this.carNumberIpt = this.carNumberIpt.substr(0, this.carNumberIpt.length -
				1);
		},
		delCar(item) {
			var i = (this.carList || []).findIndex((profile) => profile.carPlate === item.carPlate);
			this.carList.splice(i, 1)
			var j = (this.carnumlist || []).findIndex((profile) => profile.name === item.carPlate);
			if (this.carnumlist[j]) return this.carnumlist[j].checked = false
		},
		boardClick() {
			this.carshow1 = true
		},
		carShowFun() {
			this.carshow = true
		},
		checkedAll() {
			this.carnumlist.map(val => {
				val.checked = true
			})
			this.ischeckedAll = false
		},
		nocheckedAll() {
			this.carnumlist.map(val => {
				val.checked = false
			})
			this.ischeckedAll = true
		},
		determineFun() {
			this.carnumlist.forEach(item => {
				if (item.checked == true) {
					var i = (this.carList || []).findIndex((profile) => profile.carPlate === item.name);
					if (i == '-1') {
						console.log(item.name)
						var carObj = {
							carPlate: item.name, //车牌号
						}
						this.carList.push(carObj)
						console.log(this.carList)
					}
				}
			})
			this.carshow = false
		},
		sucAdd(e) {
			console.log(this.carNumberIpt)
			//车牌号
			var regC =
				/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领])|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][0-9]{2}([0-9]|[A-Z]){5}))$/;
			if (!regC.test(this.carNumberIpt)) return uni.showToast({
				title: '车牌号格式不正确，请检查',
				duration: 5000,
				icon: 'none',
			});
			else {
				this.carList.push({
					// checked: false,
					carPlate: this.carNumberIpt
				})
				console.log(this.carList)
				this.carNumberIpt = ''
			}
		},
		carclose() {
			this.carSearch = ''
		},
		checkboxGroupChange() {
			var arr = []
			this.carnumlist.map(val => {
				if (val.checked == true) {
					arr.push(arr)
				}
			})
			if (arr.lenth == this.carnumlist.length) {
				this.ischeckedAll = false
			} else {
				this.ischeckedAll = true
			}
		},
		// 查询上一次选的站点
		xhdzFun() {
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			let id = '';
			if (this.userinfo.sign == 'CUS-1') {
				id = this.userinfo.ORMTB400ID
			} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
				id = this.userinfo.ORMTB410ID
			}
			uni.request({
				url: this.baseUrl + '/orm/ormtb492/ormtb492ListLast',
				method: 'POST',
				dataType: 'json',
				data: {
					ORMTB410ID: id,
				},
				success: (res) => {
					console.log('res.data.data.data[0]', res.data.data.data);
					if (res.data.code == 200) {
						if (!res.data.data.data || res.data.data.data.length == 0) {
							this.xhdztitle = {}
						} else {
							this.xhdztitle = res.data.data.data[0]
						}
					} else {
						uni.showToast({
							title: res.errMsg,
							type: 'default',
							icon: false
						})
					}
					uni.hideLoading();
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: res.errMsg,
						type: 'default',
						icon: false
					})
				}
			});
		},
		//车牌输入input发生变化
		valChange() {
			this.carnumlist = []
			this.carSearch = this.carSearch.toUpperCase()
			uni.showLoading({
				title: '请求中...',
				mask: true
			});
			if (this.userinfo.sign == 'CUS-1') {
				var ID = this.userinfo.ORMTB400ID
			} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
				var ID = this.userinfo.ORMTB410ID
			}
			var ID = this.userinfo.ORMTB410ID
			uni.request({
				url: this.baseUrl + '/set/settb402/selectSettb402BySign',
				method: 'POST',
				dataType: 'json',
				data: {
					sign: this.userinfo.sign,
					SETTB402CA00: this.carSearch,
					ID: ID
				},
				success: (res) => {
					// console.log(res);
					if (res.data.code == 200) {
						var data = res.data.data
						this.carnumlist = []
						data.forEach(item => {
							this.carnumlist.push({
								checked: false,
								name: item.SETTB402CA00,
								disabled: false,
							})
						})
					} else {

					}
					uni.hideLoading();
				},
				fail: (res) => {
					uni.hideLoading();
					uni.showToast({
						title: res.errMsg,
						type: 'default',
						icon: false
					})
				}
			});
		},
		// 确定
		determine() {
			if (!this.xhdztitle) {
				return uni.showToast({
					title: '请选择站点地',
					duration: 5000,
					icon: 'none',
				});
			}

			if (this.xhdztitle.ORMTB491CA00 == '') {
				return uni.showToast({
					title: '请选择站点地',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.wlcj == -1) {
				return uni.showToast({
					title: '请选择厂家',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.wllx == -1) {
				return uni.showToast({
					title: '请选择物料',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.sldj == '') {
				return uni.showToast({
					title: '请输收料单价',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.slds == '') {
				return uni.showToast({
					title: '请输收料吨数',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.kd == '') {
				return uni.showToast({
					title: '请输入所承担的亏吨范围',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.msgobj.cssj == '') {
				return uni.showToast({
					title: '请输入超时自动取消时间',
					duration: 5000,
					icon: 'none',
				});
			}
			if (this.iszdcl == true) {
				if (this.carList.length == 0) {
					return uni.showToast({
						title: '选择车辆',
						duration: 5000,
						icon: 'none',
					});
				}
			}
			this.addCarLoginShow = true
		},
		addCarNewConfirm() {
			let id = '';
			if (this.userinfo.sign == 'CUS-1') {
				id = this.userinfo.ORMTB400ID
			} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
				id = this.userinfo.ORMTB410ID
			}
			let selectedValues = this.selectedValues.join(',');
			uni.request({
				url: this.baseUrl + '/orm/ormtb493/createOrmtb493',
				method: 'POST',
				dataType: 'json',
				data: {
					ORMTB493CA02: this.cx, //车型
					ORMTBZS410ID: this.msgobj.dfzhId, //代发账户ID
					ORMTB493CA34: this.msgobj.glf, //管理费比例
					ORMTB493CA03: selectedValues, //厂家ID  selectedValues
					ORMTB493CA05: this.msgobj.wllxCode, //物料类型编号
					ORMTB493CA08: this.msgobj.slds, //需求吨数
					ORMTB493CA07: this.msgobj.sldj, //收料单价
					ORMTB493CA25: this.msgobj.kd, //亏吨范围
					ORMTB493CA20: this.xhdztitle.ORMTB492ID, //站点id
					ORMTB493CA27: this.msgobj.cssj, //超时自动取消时间
					ORMTB493CA30: this.iszdcldata, //是否指定车牌
					ORMTB410ID: id, //当前登录人
					ORMTB493CA31: this.isgkdata, //是否公开
					ORMTB493CA32: this.isjdwldata, //是否冻结接单物料
					ormtb461List: this.carList, //指定车牌号
					// sign: this.userinfo.sign,
				},
				success: (res) => {
					console.log(res);
					if (res.data.code == 200) {
						uni.showToast({
							title: '发布成功',
							duration: 5000,
							icon: 'none',
						});
						uni.navigateBack()
					} else {
						uni.showToast({
							title: res.data.message,
							duration: 5000,
							icon: 'none',
						});
					}
				},
				fail: (res) => {
					uni.showToast({
						title: res.data.message,
						duration: 5000,
						icon: 'none',
					});
				}
			});
		},
	}
}
</script>

<style lang="scss" scoped>
.flex {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;

	/deep/ .picker-view {
		flex: 1;

		.select-wrap {
			width: 100%;

			.select-content-item-default {
				color: #666;
			}
		}
	}
}

/* 列表 */

/* 内容 */
.addCar-content-box {
	/* width: 100%; */
	background: rgba(255, 255, 255, 1);
	padding: 10rpx;
}

.addCar-content-box .addCar-content-box-title {
	width: 100%;
	height: 80rpx;
}

.addCar input {
	border: 0;
}

.addCar {
	width: 100%;
	min-height: 100vh;
	background-color: rgba(242, 242, 242, 1);
	overflow: hidden;
}

/* 列表 */

/* 内容 */
.addCar-content-box {
	/* width: 100%; */
	background: rgba(255, 255, 255, 1);
	padding: 10rpx 24rpx;
	margin: 20rpx;
	border-radius: 20rpx;
	box-shadow: 4rpx 4rpx 20rpx #e5e5e5;
}

.addCar-carName-phone {
	border-bottom: 2rpx solid rgba(230, 230, 230, 0.5);
	padding: 18rpx 0;
	display: flex;
	justify-items: center;
	align-items: center;
}

.addCar-input-one {
	margin-bottom: 0 !important;
	padding: 0 !important;
	height: 44rpx !important;
	vertical-align: middle;
	color: rgba(51, 51, 51, 1);
	font-size: 32rpx;
	flex: 1;
}

.addCar-phone {
	// width: 280rpx;
	font-size: 32rpx;
	color: rgba(102, 102, 102, 1);
}

.addCar-phone-placeholder {
	width: 100%;
	flex: 1;
	font-size: 30rpx;
	color: #666;
}

.addCar-dun {
	color: rgba(51, 51, 51, 1);
	font-size: 30rpx;
}

/* 按钮 */
.addCar-reset-determine {
	margin-top: 130rpx;
	display: flex;
	justify-content: center;
	padding-bottom: 60rpx;
}

.addCar-reset-determine>view {
	width: 80%;
	text-align: center;
	line-height: 100rpx;
	color: rgba(255, 255, 255, 1);
	font-size: 32rpx;
	border-radius: 20rpx;
}

.addCar-reset {
	width: 159rpx;
	background: rgba(234, 197, 15, 1);
	text-align: center;
	/* margin-left: 170rpx; */
	margin: 0 20rpx;
}

.addCar-determine {
	background: rgba(0, 161, 244, 1);
	/* margin-left: 60rpx; */
}

.add-phone-main {
	position: relative;
}

.add-phone {
	position: absolute;
	top: 20rpx;
	right: 0;
	/* font-size: 50rpx; */
	color: rgba(0, 255, 127, 1);
	/* background: rgba(0, 255, 127, 1); */

}

.addCar-phone-car {
	display: inline-block;
	width: 310rpx;
	height: 44rpx;
	line-height: 44rpx;
	/* border: 1px solid rgba(0, 0, 0, .2); */
	/* border-radius: 3px; */
	text-align: center;
	vertical-align: middle;
	font-size: 30rpx;
}

input::placeholder {
	color: rgba(102, 102, 102, .5);
}

.item-box {
	display: flex;
}

.zhuang-huo-dizhi {
	background-color: #303133;
	color: #fff;
	border-radius: 50%;
	width: 50rpx;
	height: 50rpx;
	display: inline-block;
	font-size: 32rpx;
	text-align: center;
	margin-right: 10rpx;
	margin-bottom: 20rpx;
}

.xie-huo-dizhi {
	background-color: #2979ff;
	color: #fff;
	border-radius: 50%;
	width: 50rpx;
	height: 50rpx;
	line-height: 50rpx;
	display: inline-block;
	font-size: 32rpx;
	text-align: center;
	margin-right: 10rpx;
	margin-left: 20rpx;
	margin-top: 24rpx;
}

.zx-addres {
	background: rgba(255, 255, 255, 1);
	border-radius: 20rpx;
	box-shadow: 4rpx 4rpx 20rpx #e5e5e5;
	display: flex;
	align-items: center;
	margin: 20rpx;
}

.cx-box {
	padding: 18rpx 0;
	border-bottom: 1px solid rgba(230, 230, 230, 0.5);
}

.text-jieshao {
	color: red;
	padding: 10rpx 24rpx;
}

.iscar-nav {
	position: fixed;
	top: 0;
	width: 100%;
	/* height: 22vh; */
	/* box-sizing: border-box; */
	z-index: 2;
	background-color: #FFF;
}

.iscar-content {
	/* margin-top: 24vh; */
}

.iscar-nav-top {
	height: 10vh;
	/* background-color: #e3e3e3; */
}

.iscar-nav-search {
	display: flex;
	/* background-color: #e3e3e3; */
	padding-bottom: 20rpx;
}

.iscar-nav-search-ipt {
	flex: 1;
}

.iscar-nav-search-btn {
	width: 100rpx;
	height: 60rpx;
	line-height: 60rpx;
	/* font-size: 28rpx; */
	text-align: center;
	color: #333;
	margin: 0 20rpx;
}

.iscar-nav-btn {
	display: flex;
	justify-content: space-between;
	height: 90rpx;
	line-height: 90rpx;
	font-size: 36rpx;
	color: #333;
	padding: 0 40rpx;
	border-top: 2rpx solid #e3e3e3;
	border-bottom: 2rpx solid #e3e3e3;
	background-color: #fff;
}

.iscar-nav-btn view+view {
	color: #02a2f4;
}

.iscar-nav-btn view {
	/* width: 100rpx; */
	text-align: center;
}

.iscar-content {
	padding-left: 30rpx;
}

.xhdz-xinxi {
	width: 87%;
	background: #fff;
	border-radius: 10px;
	display: flex;
	justify-content: space-between;
}

.xh-text {
	background: #fff;
	border-radius: 20rpx 0 0 20rpx;
	margin-left: 10rpx;
}

/* .uni-picker-container .uni-picker-item{
		font-size: 40rpx !important;
	} */
</style>
